package com.hisoft.client;

import com.hisoft.factory.SearchClientFallbackFactory;
import com.hisoft.fallback.SearchClientFallback;
import com.hisoft.pojo.Customer;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @program: springcloud2020
 * @description:
 * @author: wlg
 * @create: 2021-11-14 13:47:41
 **/
@FeignClient(value = "SEARCH",fallbackFactory = SearchClientFallbackFactory.class)
public interface SearchClient {
    @GetMapping("/search")
    String search();

    @GetMapping("/search/{id}")
    Customer findById(@PathVariable Integer id);

    @GetMapping("/getCustomer")
    Customer getCustomer(@RequestParam Integer id, @RequestParam String name);

    @PostMapping("/save")
        //会自动转为post请求   405
    Customer save(@RequestBody Customer customer);
}
